if ~rd then call exitreq( locales(MSG_ERRORWITH) locales(MSG_ARGHELP))
select
when UPPER(MODE)="DOWN" then call getfiles()
otherwise call search_GUI()
end
exit
search_GUI:
call loadprefs()
call storedefs()
if ~open(pipe,'awnpipe:Aminet.awnp/xc') then exit(2)
parse var WIN winl wint winw winh .
call topipe('"Aminet.awnp 'locales(MSG_SEARCHFIND) vern' Bruce" defg left 'winl' top 'wint' width 'winw' height 'winh' a v si so h m ig it "AmFind.Zzz" ii "'prog'" ps "'screen'" st "Aminet.awnp 'locales(MSG_SEARCHFIND) vern' By Bruce Steers <bsteers@ukonline.co.uk>"')
call topipe('id 'lvw' sc="¤" addn gt "Clipper.lha¤util/irc¤51K¤214¤Multi-clipboard support for all prog"')
call topipe('id 'lvw' sc="¤" addn gt "clipper.lha¤util/edit¤50K¤48¤VERY Handy Listview tool to set the"')
call topipe('id 'lvw' sc="¤" addn gt "Clipper_AWNP.lha¤util/wb¤62K¤48¤Handy Listview tool to set the Clipb"')
end
*/
if (name~='') & wait==0 then call searchfunc
do while ~eof(pipe)
call writeln(pipe,'id 0 read'); WIN=readln(pipe);
call topipe('con')
in=readln(pipe)
parse var in in1 in2 in3 in4 in5 in6
select
when in1=='' then nop
when in1=='iconify' then call topipe('id 0 s '64-(32*in2))
when in1=='menu' then call Mmenu()
when in1=='close' then call go()
when in1=='help' then if bubble==1 then call Mhelp()
when in1=='gadget' then call Mgadget()
when in1=='tick' then nop
otherwise say in
end
end
go: /* Check for Changed Settings */
cp=0
cs=''
if chsite then do; cp=cp+1; cs=cs||locales(MSG_AMIPRF)'*n'; end
if O_LENGTH~=LENGTH then do; cp=cp+1; cs=cs||locales(LAB_MAXHITS)'*n'; end
if O_PWIN~=PWIN then do; cp=cp+1; cs=cs||locales(MSG_PDIMS)'*n'; end
if O_WIN~=WIN then do; cp=cp+1; cs=cs||locales(MSG_SDIMS)'*n'; end
if O_README~=README then do; cp=cp+1; cs=cs||locales(MSG_GETR)'*n'; end
if O_DIR~=DIR then do; cp=cp+1; cs=cs||locales(MSG_DL_PATH)'*n'; end
if O_ASKDIR~=ASKDIR then do; cp=cp+1; cs=cs||locales(MSG_POPD)'*n'; end
if O_SITE~=SITE then do; cp=cp+1; cs=cs||locales(MSG_DEFS)'*n'; end
if O_BUBBLE~=BUBBLE then do; cp=cp+1; cs=cs||locales(MSG_BUBL)'*n'; end
if O_STARTRX~=STARTRX then do; cp=cp+1; cs=cs||locales(MSG_ONCOM)' Command *n'; end
if O_ENDRX~=ENDRX then do; cp=cp+1; cs=cs||locales(MSG_OFFCOM)' Command *n'; end
if O_ONRETURN~=ONRETURN then do; cp=cp+1; cs=cs||locales(LAB_ONRET)' *n'; end
if cp~=0 then
if req('"'locales(MSG_ChPrf)'*n*n*n'strip(cs)'"') then
call saveprefs()
call close(pipe)
if endrx~='' then address command endrx
exit
exitreq:
call req('"'arg(1)'" "_OK"')
exit
Mmenu:
select
when in3==0 then call req('"Aminet.awnp*n'ver'*n*nBruce Steers <bsteers@ukonline.co.uk>*n *nhttp://web.ukonline.co.uk/bsteers/*nhttp://web.ukonline.co.uk/awnpipe/" "'locales(MSG_OK)'"')
when in3==2 then do; if in5==0 & bubble==1 then call topipe('bubble'); bubble=in5; end
when in3==4 then call prefs()
when in3==6 then call newver()
when in3==8 then call go()
otherwise nop
end
return
Mgadget:
select
when in2==xit then call go()
when in2==prf then call prefs()
when in2==sch then call searchfunc()
when in2==get then call initDL();
when in2==sng then do; site=in3+1; parse var ams.site '://'amd'/' .; end
when in2==ptn then do; parse var in . . name; name=strip(name); if name=='' then do;
call topipe('id 'sch' dis 1');
return; end; call topipe('id 'sch' dis 0');
if ONRETURN then do; in2=sch; call Mgadget(); end
end
when in2==hit then length=in3
when in2==rec then do; call topipe('id 'abrt' dis 0'); call recent(); call topipe('id 'abrt' dis 1'); end
when in2==rme then readme=in3
when in2==dlp then askdir=in3
when in2==vrm then do; call topipe('id 0 s 256'); call viewr(); call topipe('id 0 s 512'); end
when in2==lvw then call listfunc()
otherwise nop
end
return
listfunc:
parse var in . . . . seld; seld=strip(seld)
seld0=words(seld)
if seld0==0 then do;
call topipe('id 'get' dis 1');
call topipe('id 'vrm' dis 1');
noget=1
return; end
if noget then do; noget=0; call topipe('id 'get' dis 0');call topipe('id 'vrm' dis 0'); end
tmp=readln(pipe); parse var tmp . lfontid lfontA .
lfontid='font 'lfontid
end; else; lfontid=''
return
req:
parse arg args
PUBSCREEN=screen
call readargs(args,'BODY,GADGETS/M,PUBSCREEN/K')
if body=="" | body=='BODY' then BODY='Are you sure ?'
if GADGETS.COUNT==0 | GADGETS.COUNT=='GADGETS.COUNT' then do;
GADGETS.0=locales(MSG_YES); GADGETS.1=locales(MSG_NO); GADGETS.COUNT=2; end
if ~open('req','awnpipe:AWNPChoice'time(s)'/xc') then exit(2)
call toreq('"'DEFTITLE'" width 150 sk m db dg v a ps "'PUBSCREEN'"')
p=1; do while p>0; p=index(body,'0A'X); if p~=0 then do; body=delstr(body,p,1); body=insert('*n',body,p-1); end; end
call toreq('layout si so cj b 5'); call toreq('space'); call toreq('label gt "*n'body'*n" underscore="'scre'"'); call toreq('space'); call toreq('le')
spos=toreq('layout cj si so b 1'); if GADGETS.COUNT == 1 then call toreq('space')
do c=0 to GADGETS.COUNT - 1; call toreq('button weiw 0 gt "'GADGETS.c'" c'); end
if GADGETS.COUNT == 1 then call toreq('space'); call toreq('le')
call toreq('open')
do while ~eof('req')
call toreq('con')
in=readln('req')
parse var in in1 in2 in3 in4 in5
select
when in1=='gadget' then if in2==(spos + GADGETS.COUNT) then ans=0; else; ans=in2-spos
when in1=='key' & (in2==68 | in2==69) then do; ans=(in2==68); call close('req'); return ans;end
otherwise nop
end
end
call close('req')
return ans
toreq: parse arg out; call writeln('req',out); res=readln('req'); parse var res res1 res2 .; if res1='ok' then return(res2); say 'error from: 'out; say ' responce: ' res; exit
do_srvlst:
srvlst='"'
do c=1 to ams0;
parse var ams.c '://'adr'/' .
srvlst=srvlst'('c')'copies(' ',2-length(c))||adr'|'; end
srvlst=substr(srvlst,1,length(srvlst)-1)'"'
return srvlst
infoline:
if index(amname,'-------')==1 then; return 1; return 0
viewr:
if infoline() then return req('"" "'locales(MSG_ERROR)'*n'locales(MSG_NOFILESEL)'" "'locales(MSG_OK)'"')
RDA_SIT = 72; strings.72 ='Number of the site. Numbers are given in Server Chooser gadget.'
RDA_REA = 73; strings.73 ='README=ON or YES to download readme files too, OR README=OFF or NO.'
RDA_ASK = 74; strings.74 ='ASKDIR=YES OR ON pop up a Dir Requester and Change the default dir.'
RDA_BUB = 75; strings.75 ='BUBBLE=ON or YES to have bubble help on at startup.'
RDA_WAI = 76; strings.76 ='ADD to args if you don''t want to auto start searching at startup.'
RDA_ONR = 77; strings.77 ='Starts the search when pressing the return gadget.'
MSG_GOTRECENT = 78; strings.78 ='File T:RECENT Already Exists!*nPress ''Use-T:RECENT'' To Re-Get the file from the server*nor ''Re-Get'' to Download the file Again.'